#ifndef ITEMEDITFORM_H
#define ITEMEDITFORM_H

#include <Item.h>
#include <QWidget>
#include <QPointer>

namespace Ui {
    class ItemEditForm;
}

class ItemEditForm : public QWidget
{
    Q_OBJECT

public:
    explicit ItemEditForm(QWidget *parent = 0);
    ~ItemEditForm();

    void setItem(Item* item);
    Item* item() const;

    void updateItem();


protected slots:

    void onChanged();


private:
    Ui::ItemEditForm *ui;

    QPointer<Item> m_item;

private slots:
    void on_descTextEdit_textChanged();
    void on_typeComboBox_currentIndexChanged(int index);
    void on_nameLineEdit_lostFocus();
    void on_nameLineEdit_returnPressed();
};

#endif // ITEMEDITFORM_H
